package com.nts.visionworks.business.application.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * ApplicationMenu generated by hbm2java
 */
@Entity
@Table(name = "application_menu", catalog = "visionworks")
public class ApplicationMenu implements java.io.Serializable
{

	private Long menuId;
	private ServiceApplication serviceApplication;
	private long parentMenuId;
	private String menuName;
	private int depth;
	private int displayOrder;
	private boolean usable;
	private boolean extendable;
	private boolean editable;
	private boolean contentsHolder;
	private String acceptableContentsTemplates;
	private Date createdDateTime;
	private long creatorId;
	private Date updatedDateTime;
	private Set<ApplicationMenuContents> applicationMenuContentses = new HashSet<ApplicationMenuContents>(
			0);

	public ApplicationMenu()
	{
	}

	public ApplicationMenu(ServiceApplication serviceApplication,
			long parentMenuId, String menuName, int depth, int displayOrder,
			boolean usable, boolean extendable, boolean editable,
			boolean contentsHolder, Date createdDateTime, long creatorId)
	{
		this.serviceApplication = serviceApplication;
		this.parentMenuId = parentMenuId;
		this.menuName = menuName;
		this.depth = depth;
		this.displayOrder = displayOrder;
		this.usable = usable;
		this.extendable = extendable;
		this.editable = editable;
		this.contentsHolder = contentsHolder;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
	}

	public ApplicationMenu(ServiceApplication serviceApplication,
			long parentMenuId, String menuName, int depth, int displayOrder,
			boolean usable, boolean extendable, boolean editable,
			boolean contentsHolder, String acceptableContentsTemplates,
			Date createdDateTime, long creatorId, Date updatedDateTime,
			Set<ApplicationMenuContents> applicationMenuContentses)
	{
		this.serviceApplication = serviceApplication;
		this.parentMenuId = parentMenuId;
		this.menuName = menuName;
		this.depth = depth;
		this.displayOrder = displayOrder;
		this.usable = usable;
		this.extendable = extendable;
		this.editable = editable;
		this.contentsHolder = contentsHolder;
		this.acceptableContentsTemplates = acceptableContentsTemplates;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.applicationMenuContentses = applicationMenuContentses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "MenuId", unique = true, nullable = false)
	public Long getMenuId()
	{
		return this.menuId;
	}

	public void setMenuId(Long menuId)
	{
		this.menuId = menuId;
	}

	@EntityIdNotNull(message = "validation.applicationMenu.serviceApplication.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ApplicationId", nullable = false)
	public ServiceApplication getServiceApplication()
	{
		return this.serviceApplication;
	}

	public void setServiceApplication(ServiceApplication serviceApplication)
	{
		this.serviceApplication = serviceApplication;
	}

	@NotNull(message = "validation.applicationMenu.parentMenuId.notNull")
	@Column(name = "ParentMenuId", nullable = false)
	public long getParentMenuId()
	{
		return this.parentMenuId;
	}

	public void setParentMenuId(long parentMenuId)
	{
		this.parentMenuId = parentMenuId;
	}

	@NotNull(message = "validation.applicationMenu.menuName.notNull")
	@Size(message = "validation.applicationMenu.menuName.length", max = 100, min = 1)
	@Column(name = "MenuName", nullable = false, length = 100)
	public String getMenuName()
	{
		return this.menuName;
	}

	public void setMenuName(String menuName)
	{
		this.menuName = menuName;
	}

	@Min(message = "validation.applicationMenu.depth.min", value = 1)
	@Column(name = "Depth", nullable = false)
	public int getDepth()
	{
		return this.depth;
	}

	public void setDepth(int depth)
	{
		this.depth = depth;
	}

	@Min(message = "validation.applicationMenu.displayOrder.min", value = 1)
	@Column(name = "DisplayOrder", nullable = false)
	public int getDisplayOrder()
	{
		return this.displayOrder;
	}

	public void setDisplayOrder(int displayOrder)
	{
		this.displayOrder = displayOrder;
	}

	@Column(name = "Usable", nullable = false)
	public boolean isUsable()
	{
		return this.usable;
	}

	public void setUsable(boolean usable)
	{
		this.usable = usable;
	}

	@Column(name = "Extendable", nullable = false)
	public boolean isExtendable()
	{
		return this.extendable;
	}

	public void setExtendable(boolean extendable)
	{
		this.extendable = extendable;
	}

	@Column(name = "Editable", nullable = false)
	public boolean isEditable()
	{
		return this.editable;
	}

	public void setEditable(boolean editable)
	{
		this.editable = editable;
	}

	@Column(name = "ContentsHolder", nullable = false)
	public boolean isContentsHolder()
	{
		return this.contentsHolder;
	}

	public void setContentsHolder(boolean contentsHolder)
	{
		this.contentsHolder = contentsHolder;
	}

	@Max(message = "validation.applicationMenu.acceptableContentsTemplates.max", value = 100)
	@Column(name = "AcceptableContentsTemplates", length = 100)
	public String getAcceptableContentsTemplates()
	{
		return this.acceptableContentsTemplates;
	}

	public void setAcceptableContentsTemplates(
			String acceptableContentsTemplates)
	{
		this.acceptableContentsTemplates = acceptableContentsTemplates;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId", nullable = false)
	public long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "applicationMenu")
	public Set<ApplicationMenuContents> getApplicationMenuContentses()
	{
		return this.applicationMenuContentses;
	}

	public void setApplicationMenuContentses(
			Set<ApplicationMenuContents> applicationMenuContentses)
	{
		this.applicationMenuContentses = applicationMenuContentses;
	}

}
